% TEST_ID: LANG-EXPAND-0126
% CATEGORY: language/string
% 测试 string 的长度

function test_string_strlength()
assert_istrue(strlength(string({'1231', '12', '我是谁'})), [4, 2, 3])
assert_istrue(strlength(string('1234')), 4)

str = "Hello, World";
L = strlength(str);
assert_istrue(L, 12);

str = ["Amis","Chekhov","Joyce";"Stein","","Proust"];
L = strlength(str);
assert_istrue(L, [4, 7, 5; 5, 0, 6]);

chr = 'The rain in Spain.';
L = strlength(chr);
assert_istrue(L, 18);

cellstr = {'The','rain','in','Spain.'};
L = strlength(cellstr);
assert_istrue(L, [3, 4, 2, 6]);
end


function assert_istrue(x,y)
    assert(isequal(x, y));
end